namespace Ds.DataBase.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Add : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.ZhiWeis",
                c => new
                    {
                        zwid = c.Int(nullable: false, identity: true),
                        zwmc = c.String(),
                    })
                .PrimaryKey(t => t.zwid);
            
            AddColumn("dbo.JiaoZhiGongInfoes", "zw_zwid", c => c.Int(nullable: false));
            CreateIndex("dbo.JiaoZhiGongInfoes", "zw_zwid");
            AddForeignKey("dbo.JiaoZhiGongInfoes", "zw_zwid", "dbo.ZhiWeis", "zwid", cascadeDelete: true);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.JiaoZhiGongInfoes", "zw_zwid", "dbo.ZhiWeis");
            DropIndex("dbo.JiaoZhiGongInfoes", new[] { "zw_zwid" });
            DropColumn("dbo.JiaoZhiGongInfoes", "zw_zwid");
            DropTable("dbo.ZhiWeis");
        }
    }
}
